<template>
  <div style="margin: auto"><h1>日志一览</h1></div>
  <el-table
      :data="cutObj.records"
      height="250"
      border
      style="width: 100%">
    <el-table-column
        prop="date"
        label="日期"
        width="300">
    </el-table-column>
    <el-table-column
        prop="info"
        label="内容"
        width="700">
    </el-table-column>
  </el-table>

  <el-pagination
      v-model:currentpage="cutObj.current"
      v-model:page-size="cutObj.size"
      background
      layout="prev, pager, next,jumper"
      :total="cutObj.total"
      @current-change="findByItem">
  </el-pagination>

  <div class="searchDiv">
    <el-row>
      <el-col :span="10" style="margin-top: 20px">起始时间<input type="date" v-model="findObj.startDate"></el-col>
    </el-row>
    <el-row>
      <el-col :span="10" style="margin-top: 20px">结束时间<input type="date" v-model="findObj.endDate"></el-col>
    </el-row>
    <el-row>
      <el-col :span="8" style="margin-top: 20px">
        <el-button type="primary" @click="findByItem(1)">搜索</el-button>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import axios from "axios"

export default {
  name: "log",
  data() {
    return {
      userObj: {},
      cutObj: {},
      findObj: {}
    }
  },
  methods: {
    findByItem(pageNo) {
      this.findObj.pageNo = pageNo;
      axios.get("/project/log/findByItem", {params: this.findObj}).then(resp => {
        this.cutObj = resp.data;
      })
    }
  },
  created() {
    this.findByItem(1)
  }
}
</script>

<style scoped>

</style>